package com.liang.factorial;

public class FactorialDemo2 {
    public static void main(String[] args) {
        int i = 5;
        int result = method(i);
        System.out.println(result);
    }

    public static int method(int i) {
        if (i == 1) {
            return 1;
        }else{
            return i * method(i - 1);
        }

    }
}
